1234567891011121314151617181920212223242526272829303132 |
- "use client";
- const Scroll = () => {
- const scrollToTop = () => {
- const parentEle = document.querySelector("#maincontainer");
- parentEle!.scrollTo({ top: 0, behavior: "smooth" });
- };
- return (
- <div className={"mt-[0.1rem] flex items-center justify-around pb-[0.5rem] text-[#fff]"}>
- <div
- className={
- "h-[0.45rem] w-[0.45rem] rounded bg-gradient-to-b from-[#ff9323]" +
- " flex items-center justify-center to-[#ff6a01]"
- }
- >
- <span className={"iconfont icon-shoucang text-[0.15rem]"}></span>
- </div>
- <div
- className={
- "flex h-[0.46rem] w-[0.46rem] rounded-[0.02rem] bg-[#25272c]" +
- " flex-col items-center justify-center text-[0.12rem]"
- }
- onClick={scrollToTop}
- >
- <span className={"iconfont icon-xiangshang text-[#ff6a01]"}></span>
- Top
- </div>
- </div>
- );
- };
- export default Scroll;
|